<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Function URLDecode(strToDecode)
  strIn = strToDecode
  strOut = ""
  intPos = Instr(strIn, "+")   'look for + and replace with space
  Do While intPos
    strLeft = ""
    strRight = ""
    If intPos > 1 Then strLeft = Left(strIn, intPos - 1)
    If intPos < Len(strIn) Then strRight = Mid(strIn, intPos + 1)
    strIn = strLeft & " " & strRight
    intPos = Instr(strIn, "+") 'and then look for next one
    intLoop = intLoop + 1
  Loop
  intPos = Instr(strIn, "%")   'look for ASCII coded characters
  Do While intPos
    If intPos > 1 Then strOut = strOut & Left(strIn, intPos - 1)
    strOut = strOut & Chr(CInt("&H" & Mid(strIn, intPos + 1, 2)))
    If intPos > (Len(strIn) - 3) Then 
      strIn = ""
    Else
      strIn = Mid(strIn, intPos + 3)
    End If
    intPos = Instr(strIn, "%") 'and then look for next one
  Loop
  URLDecode = strOut & strIn
End Function
</SCRIPT>
